import {requests} from '@/utils/requestApi.js';

async function getBaiduRecommendData(searchContent,searchEngine) {
	return await requests(`https://dtools.cpolar.cn/api/dtools-utils/utils/search/recommend?searchValue=${searchContent}&searchEngine=${searchEngine}`)
}

async function syncWebFavorites(webFavorites) {
	// return await requests(`https://dtools.cpolar.cn/api/dtools-finderIQ/userdata/sync/webFavorites`, "POST", webFavorites)
}

async function deleteWebFavorite(id) {
	return await requests(`https://dtools.cpolar.cn/api/dtools-finderIQ/userdata/delete/webFavorites/${id}`, "GET")
}

async function saveWebFavorite(webFavorite) {
	return await requests(`https://dtools.cpolar.cn/api/dtools-finderIQ/userdata/save/webFavorites`, "POST", webFavorite)
}

export default {
	getBaiduRecommendData,
	syncWebFavorites,
	deleteWebFavorite,
	saveWebFavorite
}
